Skip to content

feat(mobile): add range text selection to message details - #5320

Merged
iscekic merged 3 commits into
mainfrom
text-select-c2c2
Aug 18, 2026
Merged

feat(mobile): add range text selection to message details#5320
iscekic merged 3 commits into
mainfrom
text-select-c2c2

Conversation

@iscekic

@iscekic iscekic commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Summary

The user can now select a range of text in the mobile agent chat. Long-press still opens the message details sheet. A new "Select text" action under "Copy message" swaps the details sheet to a "Select text" view that shows the copyable message body in a read-only selectable field. The user selects a range and uses the platform copy callout.

For the product manager: the app gains a "Select text" action on the message details sheet for finished messages with copyable text. A streaming message hides the action; a message with no copyable text shows neither "Copy message" nor "Select text".

For the maintainer: getMessageDetailsContent now projects canSelectText, true only when the message has copyable text and no part is in flight. A user text part never streams; an assistant text part is in flight only when time exists without end. Reasoning and tool parts reuse isPartStreaming. A new MessageTextSelectSheet content view reuses SelectableText and swaps into the single details Modal.

Verification

  • pnpm typecheck, pnpm lint, pnpm format:check pass in apps/mobile.
  • Unit and mounted tests pass (4 files, 37 tests).
  • E2E (iOS simulator): long-press opens details; Select text swaps to the select view; in-bubble markdown does not enter native selection.

Visual Changes

The details sheet gains a "Select text" action under "Copy message":

s1-user-details.png

Tapping it swaps the sheet to a read-only selectable view of the message body:

s2-selectview.png

Reviewer Notes

  • Streaming hide is unit/mounted tested only; no live E2E streaming case (a short prompt finishes before the long-press).
  • The Select text view swaps content inside the single details Modal (a nested pageSheet never presents on iOS). E2E S2 is the live check.

No human steps are needed.

Add a Select text action under Copy message in the message details
sheet. It opens a child page-sheet that reuses SelectableText to show
the copyable body for platform range selection.

Project canSelectText from getMessageDetailsContent: true only when the
message has copyable text and no part is in flight. A user text part
never streams; an assistant text part is in flight only when time exists
without end. Reasoning and tool parts reuse isPartStreaming.
@iscekic iscekic self-assigned this Aug 18, 2026
@kilo-code-bot

kilo-code-bot Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

Incremental review of commit 33849fe0 (return to details view on Android back in select text): the previously reported Android hardware-back issue is resolved — onRequestClose now calls setSelectVisible(false) while the Select text view is active, matching the Done button behavior, and a mounted test covers the regression; no new issues found in the changed code.

Files Reviewed (2 files)
  • apps/mobile/src/components/agents/message-details-sheet.tsx
  • apps/mobile/src/components/agents/message-details-sheet.mounted.test.tsx
Previous Review Summaries (2 snapshots, latest commit ec6c923)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit ec6c923)

Status: 1 Issue Found | Recommendation: Address before merge

Executive Summary

Incremental review of the follow-up commit (swap details sheet content instead of nesting a second Modal): the single-Modal refactor makes the Android hardware back button dismiss the whole details sheet while in the Select text view, whereas the view's "Done" button and the previous child-Modal behavior returned to the details view.

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
apps/mobile/src/components/agents/message-details-sheet.tsx 50 Android back in Select text view closes the entire details sheet instead of returning to the details view
Files Reviewed (3 files)
  • apps/mobile/src/components/agents/message-details-sheet.mounted.test.tsx
  • apps/mobile/src/components/agents/message-details-sheet.tsx - 1 issue
  • apps/mobile/src/components/agents/message-text-select-sheet.tsx

Fix these issues in Kilo Cloud

Previous review (commit 81c9f1b)

Status: No Issues Found | Recommendation: Merge

Executive Summary

Reviewed the range text selection feature for the mobile message details sheet (5 files, +485/-64): the canSelectText projection in getMessageDetailsContent, the new MessageTextSelectSheet child page-sheet, and the unit/mounted test coverage. The in-flight detection (isPartInFlightForSelect) is deliberately narrower than isPartStreaming for text parts and is documented and tested for both roles; select-sheet state is reset when the details sheet closes; the empty-text guard prevents rendering SelectableText with no content; no new subscriptions, timers, or listeners are introduced, so no memory-leak surface is added. No high-confidence correctness, security, or performance issues found.

Files Reviewed (5 files)
  • apps/mobile/src/components/agents/message-details-content.ts
  • apps/mobile/src/components/agents/message-details-sheet.mounted.test.tsx
  • apps/mobile/src/components/agents/message-details-sheet.test.ts
  • apps/mobile/src/components/agents/message-details-sheet.tsx
  • apps/mobile/src/components/agents/message-text-select-sheet.tsx

Reviewed by kimi-k3 · Input: 48.1K · Output: 2.9K · Cached: 175.3K

Review guidance: REVIEW.md from base branch main

…odal

A second pageSheet Modal rendered as a sibling of the already-presented
details pageSheet never presents on iOS. Swap the single Modal's content:
when Select text is tapped, the details Modal renders the select view
(SheetHeader 'Select text' plus the selectable body) in place of the
details content. Select text Done returns to details; details Done closes
the sheet.
Comment thread apps/mobile/src/components/agents/message-details-sheet.tsx Outdated
The single details Modal closed the whole sheet on Android hardware back
even while the Select text view was shown, inconsistent with the Done
button. Route onRequestClose back to the details view when selectVisible
is true.
@iscekic iscekic added the human-ready The PR is ready for human review. label Aug 18, 2026
@iscekic
iscekic merged commit 3a28aa5 into main Aug 18, 2026
18 checks passed
@iscekic
iscekic deleted the text-select-c2c2 branch August 18, 2026 10:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

human-ready The PR is ready for human review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants